Repository navigation
Conversation
|
This is a generalization of #4770 |
JukkaL
left a comment
There was a problem hiding this comment.
Thank you for your attention to detail! Left some comments about methods that don't appear to be special even though they are included in the operator module. Otherwise looks good.
| def __getitem__(self, other: Any) -> 'A': return NotImplemented # E: Returning Any from function declared to return "A" | ||
| def __int__(self) -> 'A': return NotImplemented # E: Returning Any from function declared to return "A" | ||
| def __index__(self) -> 'A': return NotImplemented # E: Returning Any from function declared to return "A" | ||
| def __inv__(self) -> 'A': return NotImplemented # E: Returning Any from function declared to return "A" |
There was a problem hiding this comment.
Again, I think that this isn't a magic method (but __invert__ is)?
There was a problem hiding this comment.
https://docs.python.org/3/library/operator.html
seems to show __inv__ and __invert__ as synonyms.
But by experiment, __inv__ doesn't work (either in Python2.7 or Python3.x).
So, is this a bug in the documentation or is there some use of __inv__ that I'm not aware of?
There was a problem hiding this comment.
It looks like __inv__ is specific to the operator module, so it doesn't need any special casing.
| def __rxor__(self, other: Any) -> 'A': return NotImplemented | ||
| def __ror__(self, other: Any) -> 'A': return NotImplemented | ||
| [builtins fixtures/notimplemented.pyi] | ||
| ======= |
There was a problem hiding this comment.
This seems extra. Replace with an empty line?
| "__and__", | ||
| "__cmp__", | ||
| "__divmod__", | ||
| "__concat__", |
There was a problem hiding this comment.
This doesn't look like a special method.
| "__gt__", | ||
| "__iadd__", | ||
| "__iand__", | ||
| "__iconcat__", |
There was a problem hiding this comment.
Similar to above, this doesn't seem to be special.
|
I re-read the documentation for magic methods and So, I need to review my changes, because there might be some additional details that both @JukkaL and I have missed. I'll add a comment when I've finished this review (and have responded to @JukkaL's other comments). |
|
I think that you accidentally added a typeshed pin update. It's causing a conflict. |
|
I am not very good at github workflow, so it's very possible that I've messed things up (and I have no idea what a github "pin update" is). |
|
Obsolete |
No description provided.